home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 May / SGI IRIX 6.5 Complementary Applications 2004 May.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 03030102.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  2.8 KB  |  43 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>DateValue Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03030102"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         p.P1{
  5.                 }
  6.         p.P2{
  7.                 }
  8.         span.T1{
  9.                 font-weight:bold;}
  10.         </style></head><body>
  11.   
  12.   
  13.   <help:to-be-embedded Eid="datevalue" xmlns:help="http://openoffice.org/2000/help"><a name="datevalue"/>
  14.   <p class="Head1"><help:link Id="66574">DateValue Function [Runtime]</help:link></p>
  15.   <p class="Paragraph">Returns a number from a date string, which represents a complete date in a single numeric value. You can use this serial number to determine the difference between two dates.</p>
  16.   </help:to-be-embedded>
  17.   <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  18.   <p class="Paragraph">DateValue [(date)] <help:key-word value="DateValue" tag="kw66574_1" xmlns:help="http://openoffice.org/2000/help"/></p>
  19.   <p class="Paragraph"><span class="T1">Return value</span>:</p>
  20.   <p class="Paragraph">Long</p>
  21.   <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  22.   <p class="Paragraph">Date: String expression that contains the date to be calculated, and can be specified in almost any format. For example, the date "06.12.1995" can be defined in any of the following formats:</p>
  23.   <p class="Paragraph">06.12.1995</p>
  24.   <p class="Paragraph">6.12.95</p>
  25.   <p class="Paragraph">6.12.1995</p>
  26.   <p class="Paragraph">6.12, 1995</p>
  27.   <p class="Paragraph">06.12, 1995</p>
  28.   <p class="Paragraph">06,12.95</p>
  29.   <p class="Paragraph">6,12.1995</p>
  30.   <p class="Paragraph">June 12, 1995</p>
  31.   <p class="Paragraph">Jun 12 95</p>
  32.   <p class="Paragraph">Jun 12, 1995</p>
  33.   <p class="Paragraph">Jun 12, 95</p>
  34.   <p class="Paragraph">06/12/1995</p>
  35.   <p class="Paragraph">Jun/12/95</p>
  36.   <p class="Paragraph">With this function, you can also convert a date between December 1, 1582 and December 31, 9999 to a single integer value, which can then be used to calculate the difference between two dates. If the date argument lies outside the acceptable range, <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic returns an error message.</p>
  37.   <p class="Paragraph">In contrast to the DateSerial function where year, month and day are passed as separate numeric values, for the DateValue function a string expression is passed in the format "month.[,]day.[,]year".</p>
  38.   <p class="P2">Example:</p>
  39.   <p class="PropText">Sub ExampleDateValue</p>
  40.   <p class="PropText">msgbox DateValue("12/02/1997") REM 12.12.1997 00:00:00</p>
  41.   <p class="PropText">end sub</p>
  42.   <p class="PropText"/>
  43.  </body></html>